<?php
require_once "ModelBase.php";

class Country extends TTEvent_Table_Abstract
{
    protected $_primary = 'nationalId';
    protected $_name = 'mytt_national';
    
    public function getCountries()
    {
        $db = $this->getSlaveDB();
        $sql = 'SELECT * FROM mytt_national';
        return $db->fetchAll($sql);
    }   
    
    public function getCitiesByCountry($cid)
    {
        $db = $this->getSlaveDB();
        $sql = 'SELECT * FROM mytt_cities WHERE nid = ?';
        return $db->fetchAll($sql, $cid);   
    }
}

